﻿using AbpStudy.Entity.Dtos;
using FluentValidation;

namespace AbpStudy
{
	public class CreateUpdateBookDtoValidator : AbstractValidator<CreateUpdateBookDto>
	{
		public CreateUpdateBookDtoValidator()
		{
			RuleFor(x => x.Name)
				.NotNull()
				.NotEmpty()
				.WithName("书名")
				.WithMessage("{PropertyName}不能为空!")
				.Length(3, 10)
				.WithMessage("{PropertyName}长度为3~10")
				;
		}
	}
}